Fix localhost live migration. We were overvigorously wiping out the store
authoremellor@ewan <emellor@ewan>
Tue, 4 Oct 2005 10:14:50 +0000 (11:14 +0100)
committeremellor@ewan <emellor@ewan>
Tue, 4 Oct 2005 10:14:50 +0000 (11:14 +0100)
commit81c4fa512f7d16b65d40357a515ff2e20312a82c
treee5ac46879d4742af021f55bbb5d4259348bec538
parent6b6edfe1d5609abbba73a53cb26909518f2a1580
Fix localhost live migration.  We were overvigorously wiping out the store
entries when a domain closed and on save, which meant that the /vm entries
disappeared when a localhost migration occurred.  XendCheckpoint has had extra
exception handling and logging added.  It also now calls back through
XendDomain.restore_,which has the correct locking semantics to prevent race
conditions during migration.

Added assertions to XendCheckpoint to ensure that the channels are set after
XendDomainInfo.restore.  I don't see why they would not be, and the old code
meant that in the case that they were not, IntroduceDomain would not be called
on the new domain, breaking Xend restart.

relocate calls through XendDomain.domain_restore_fd rather than directly to
XendCheckpoint to isolate XendCheckpoint from the rest of the world, and to
allow XendDomain to pass itself into XendCheckpoint for a callback.

Simplify the XendCheckpoint / XendDomainInfo interlock, giving only two
states, OK and TERMINATED.  If XendCheckpoint asks for a suspend, but sees a
shutdown, it is valid for it to proceed -- either way the domain has stopped.
Higher level tools may wish to disallow this, but at the very least, there is
no sense in waiting for a suspend that will never come.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/XendCheckpoint.py
tools/python/xen/xend/XendDomain.py
tools/python/xen/xend/XendDomainInfo.py
tools/python/xen/xend/server/relocate.py